package com.ugoodtech.mdcc.web.controller;

import com.ugoodtech.mdcc.core.Constants;
import com.ugoodtech.mdcc.core.LogConstants;
import com.ugoodtech.mdcc.core.domain.QuestionAnswerOption;
import com.ugoodtech.mdcc.core.domain.User;
import com.ugoodtech.mdcc.core.domain.UserProfile;
import com.ugoodtech.mdcc.core.domain.VstarCustomerSatisfactionReport.CustomerStatVo;
import com.ugoodtech.mdcc.core.domain.VstarCustomerSatisfactionReport.VstarCustomerSatisfactionReport;
import com.ugoodtech.mdcc.core.repository.*;
import com.ugoodtech.mdcc.core.service.CustomerSatisfactionReportService;
import com.ugoodtech.mdcc.core.utils.DateUtil;
import com.ugoodtech.mdcc.web.dto.CustomerStatResponse;
import com.ugoodtech.mdcc.web.dto.JsonResponse;
import com.ugoodtech.mdcc.web.dto.KpiResponseForOut;
import com.ugoodtech.mdcc.web.service.ExportReportService;
import com.ugoodtech.mdcc.web.service.VstarCustomerSatisfactionReportService;
import com.ugoodtech.mdcc.web.utils.SvgRasterizer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.UnsupportedEncodingException;
import java.text.DecimalFormat;
import java.util.*;

@Api(description = "客户满意度报告统计")
@RestController
@RequestMapping("VstarCustomerSatisfactionReport/VstarCustomerSatisfactionReport")
public class VstarCustomerSatisfactionReportController extends BaseController {


    @Autowired
    private VstarCustomerSatisfactionReportService vstarCustomerSatisfactionReportService;

    @Autowired
    private StationRepository stationRepository;

    @Autowired
    private UserRepository userRepository;

    @Autowired
    private UserProfileRepository userProfileRepository;

    @Autowired
    private ExportReportService exportReportService;

    @Autowired
    private WarningProcessing warningProcessing;

    @Autowired
    private QuestionAnswerOptionRepository questionAnswerOptionRepository;

    @Autowired
    private CustomerSatisfactionReportService customerSatisfactionReportService;

    private static final Logger logger = LoggerFactory.getLogger(VstarCustomerSatisfactionReportController.class);


    @ApiOperation("统计满意度查询--改")
    @RequestMapping(value = "customerStat", method = RequestMethod.GET)
    public JsonResponse statReport(@ApiParam("登陆用户ID") @RequestParam(value = "loginUserId") Long loginUserId,
                                   @ApiParam("省份多选") @RequestParam(value = "provinces", required = false) String provinces,
                                   @ApiParam("品牌") @RequestParam(value = "brandname", required = false) String brandname,
                                   @ApiParam("维修站ID") @RequestParam(value = "category", required = false) String category,
                                   @ApiParam("维修站名称") @RequestParam(value = "stationId", required = false) Long stationId,
                                   @ApiParam("服务开始时间") @RequestParam(value = "serviceStartTime", required = false) Long serviceStartTime,
                                   @ApiParam("服务结束时间") @RequestParam(value = "serviceEndTime", required = false) Long serviceEndTime,
                                   @ApiParam("开始时间") @RequestParam(value = "startTime", required = false) Long startTime,
                                   @ApiParam("结束时间") @RequestParam(value = "endTime", required = false) Long endTime,
                                   @ApiParam("服务项目") @RequestParam(value = "serviceType", required = false) Long serviceType,
                                   @ApiParam("服务次数") @RequestParam(value = "serviceNum", required = false) Integer serviceNum,
                                   @ApiParam("技术人员ID") @RequestParam(value = "userId", required = false) Long userId,
                                   @ApiParam("是否有待跟进") @RequestParam(value = "isFollowUp", required = false) Boolean iFillin,
                                   @ApiParam("满意度分数") @RequestParam(value = "score", required = false) String scoreType,
                                   @ApiParam("处理状态") @RequestParam(value = "followType", required = false) String followType,
                                   @ApiParam(value = "维修站编号") @RequestParam(value = "stationNum", required = false) String stationNum,
                                   @ApiParam(value = "部门") @RequestParam(value = "departmentId", required = false) Long departmentId) {
        isUserLogin();
        User user = userRepository.findOne(loginUserId);
        if (user == null) {
            return JsonResponse.errorResponseWithError("抱歉", "未找到当前登陆用户");
        }
//        ModuleAuthority moduleAuthority = moduleAuthorityRepository.findByName(Constants.REPORT_STATISTICS_PC);
//        boolean tf = user.getAuthorities().contains(moduleAuthority);
//        if (tf == false) {
//            return JsonResponse.errorResponseWithError("抱歉", "没有权限查看报告统计（PC）");
//        }
        com.ugoodtech.mdcc.core.dto.JsonResponse response = customerSatisfactionReportService.statReport(provinces, brandname, category, stationId, serviceStartTime, serviceEndTime, startTime, endTime,
                serviceType, serviceNum, userId, iFillin, scoreType, followType, loginUserId, stationNum, departmentId);
        return JsonResponse.successResponseWithData(response);
    }

    @ApiOperation("获取满意度分数表格--改")
    @RequestMapping(value = "getScore", method = RequestMethod.GET)
    public JsonResponse getScore(@ApiParam("登陆用户ID") @RequestParam(value = "loginUserId") Long loginUserId,
                                 @ApiParam("省份多选") @RequestParam(value = "provinces", required = false) String provinces,
                                 @ApiParam("品牌") @RequestParam(value = "brandname", required = false) String brandname,
                                 @ApiParam("维修站ID") @RequestParam(value = "category", required = false) String category,
                                 @ApiParam("维修站名称") @RequestParam(value = "stationId", required = false) Long stationId,
                                 @ApiParam("服务开始时间") @RequestParam(value = "serviceStartTime", required = false) Long serviceStartTime,
                                 @ApiParam("服务结束时间") @RequestParam(value = "serviceEndTime", required = false) Long serviceEndTime,
                                 @ApiParam("开始时间") @RequestParam(value = "startTime", required = false) Long startTime,
                                 @ApiParam("结束时间") @RequestParam(value = "endTime", required = false) Long endTime,
                                 @ApiParam("服务项目") @RequestParam(value = "serviceType", required = false) Long serviceType,
                                 @ApiParam("服务次数") @RequestParam(value = "serviceNum", required = false) Integer serviceNum,
                                 @ApiParam("技术人员ID") @RequestParam(value = "userId", required = false) Long userId,
                                 @ApiParam("是否有待跟进") @RequestParam(value = "isFollowUp", required = false) Boolean iFillin,
                                 @ApiParam("满意度分数") @RequestParam(value = "score", required = false) String scoreType,
                                 @ApiParam("处理状态") @RequestParam(value = "followType", required = false) String followType,
                                 @ApiParam(value = "维修站编号") @RequestParam(value = "stationNum", required = false) String stationNum,
                                 @ApiParam(value = "部门") @RequestParam(value = "departmentId", required = false) Long departmentId

    ) {
        isUserLogin();
        User user = userRepository.findOne(loginUserId);
        if (user == null) {
            return JsonResponse.errorResponseWithError("抱歉", "未找到当前登陆用户");
        }
        com.ugoodtech.mdcc.core.dto.JsonResponse response = customerSatisfactionReportService.getScore(provinces, brandname, category, stationId, serviceStartTime, serviceEndTime, startTime, endTime,
                serviceType, serviceNum, userId, iFillin, scoreType, followType, loginUserId, stationNum, departmentId);
        return JsonResponse.successResponseWithData(response);
    }

    @ApiOperation("导出满意度分数表格--改")
    @RequestMapping(value = "getCustomerResponseOut", method = RequestMethod.POST)
    public JsonResponse getCustomerResponseOut(Long loginUserId, HttpServletRequest request, HttpServletResponse response,
                                               @RequestBody KpiResponseForOut kpiResponse,
                                               @ApiParam("省份多选") @RequestParam(value = "provinces", required = false) String provinces,
                                               @ApiParam("品牌") @RequestParam(value = "brandname", required = false) String brandname,
                                               @ApiParam("维修站ID") @RequestParam(value = "category", required = false) String category,
                                               @ApiParam("维修站名称") @RequestParam(value = "stationId", required = false) Long stationId,
                                               @ApiParam("服务开始时间") @RequestParam(value = "serviceStartTime", required = false) Long serviceStartTime,
                                               @ApiParam("服务结束时间") @RequestParam(value = "serviceEndTime", required = false) Long serviceEndTime,
                                               @ApiParam("开始时间") @RequestParam(value = "startTime", required = false) Long startTime,
                                               @ApiParam("结束时间") @RequestParam(value = "endTime", required = false) Long endTime,
                                               @ApiParam("服务项目") @RequestParam(value = "serviceType", required = false) Long serviceType,
                                               @ApiParam("服务次数") @RequestParam(value = "serviceNum", required = false) Integer serviceNum,
                                               @ApiParam("技术人员ID") @RequestParam(value = "userId", required = false) Long userId,
                                               @ApiParam("是否有待跟进") @RequestParam(value = "isFollowUp", required = false) Boolean iFillin,
                                               @ApiParam("满意度分数") @RequestParam(value = "score", required = false) String scoreType,
                                               @ApiParam("处理状态") @RequestParam(value = "followType", required = false) String followType,
                                               @ApiParam(value = "维修站编号") @RequestParam(value = "stationNum", required = false) String stationNum,
                                               @ApiParam(value = "部门") @RequestParam(value = "departmentId", required = false) Long departmentId) throws Exception {
        isUserLogin();
        JsonResponse data = statReport(loginUserId, provinces, brandname, category, stationId, serviceStartTime, serviceEndTime, startTime, endTime, serviceType, serviceNum, userId, iFillin, scoreType, followType, stationNum, departmentId);
        JsonResponse socre = getScore(loginUserId, provinces, brandname, category, stationId, serviceStartTime, serviceEndTime, startTime, endTime, serviceType, serviceNum, userId, iFillin, scoreType, followType, stationNum, departmentId);
        CustomerStatVo customerStatVo = new CustomerStatVo();
        JsonResponse dataJson = (JsonResponse) data.getData();
        JsonResponse scoreJson = (JsonResponse) socre.getData();
        VstarCustomerSatisfactionReport vstarCustomerSatisfactionReport = (VstarCustomerSatisfactionReport) dataJson.getData();
        customerStatVo.setData(vstarCustomerSatisfactionReport);
        customerStatVo.setSocre((List<String[]>) scoreJson.getData());
        customerStatVo.setResponseKpi(kpiResponse.getKpiResponse());
        String templetPath = request.getSession().getServletContext().getRealPath("");

        String filePath = exportReportService.genCustomerStatReport(customerStatVo, templetPath);
        try {
            userLogService.addUserLog(this.getCurrentUser(), stationNum,
                    LogConstants.operate_type_send_export,
                    LogConstants.business_type_customer_report, null, null);
        } catch (Exception e) {
            e.printStackTrace();
        }

        //导出日志============================================
        try {
            Map<String, Object> searchParams = new HashMap<>();
            searchParams.put("省份", provinces);
            searchParams.put("品牌", brandname);
            searchParams.put("维修站类型", category);
            if (null != stationId) {
                searchParams.put("维修站名称", stationRepository.findOne(stationId).getName());
            }
            if (null != serviceStartTime) {
                searchParams.put("服务开始时间", com.ugoodtech.mdcc.core.utils.DateUtil.formatDate(new Date(serviceStartTime), Constants.DATE_FORMAT));
            }
            if (null != serviceEndTime) {
                searchParams.put("服务结束时间", com.ugoodtech.mdcc.core.utils.DateUtil.formatDate(new Date(serviceEndTime), Constants.DATE_FORMAT));
            }
            if (null != startTime) {
                searchParams.put("开始时间", com.ugoodtech.mdcc.core.utils.DateUtil.formatDate(new Date(startTime), Constants.DATE_FORMAT));
            }
            if (null != endTime) {
                searchParams.put("结束时间", DateUtil.formatDate(new Date(endTime), Constants.DATE_FORMAT));
            }
            if (null != serviceType) {
                QuestionAnswerOption questionAnswerOption = questionAnswerOptionRepository.findOne(serviceType);
                searchParams.put("服务项目", questionAnswerOption.getName());
            }
            if (null != serviceNum && 0 != serviceNum) {
                searchParams.put("服务次数", serviceNum);
            }
            if (null != userId) {
                UserProfile user = userProfileRepository.findByUserId(userId);
                searchParams.put("技术人员", user.getRealName());
            }
            if (null != iFillin) {
                if (iFillin) {
                    searchParams.put("是否有待跟进", "是");
                } else {
                    searchParams.put("是否有待跟进", "否");
                }
            }
            searchParams.put("满意度分数", scoreType);
            searchParams.put("处理状态", followType);
            searchParams.put("维修站编号", stationNum);
            String desc = "筛选了:";
            for (String key : searchParams.keySet()) {
                if (null != searchParams.get(key) && !StringUtils.isEmpty(searchParams.get(key).toString())) {
                    desc += (key + "=>" + searchParams.get(key) + " ,");
                }
            }
            if ("筛选了:".equals(desc)) {
                desc = "";
            }
            Map<String, Object> logData = new HashMap<>();
            logData.put("str", desc);
            userLogService.addUserLog(this.getCurrentUser(), null,
                    LogConstants.operate_type_send_export,
                    LogConstants.business_type_customer_report, null, logData);
        } catch (Exception e) {
            e.printStackTrace();
        }
        filePath = Constants.v_starServiceUrl + filePath;
//        filePath = "http://vr.duluxdesigner.com.cn" + filePath;
//        filePath = "http://116.62.64.140:51002" + filePath;

        return JsonResponse.successResponseWithData(filePath);
    }

    @ApiOperation("满意度报告导出--EXCEL")
    @RequestMapping(value = "exportExcelOut", method = RequestMethod.POST)
    public JsonResponse exportExcelOut(Long loginUserId, HttpServletRequest request, HttpServletResponse response,
                                       @RequestBody KpiResponseForOut kpiResponse,
                                       @ApiParam("省份多选") @RequestParam(value = "provinces", required = false) String provinces,
                                       @ApiParam("品牌") @RequestParam(value = "brandname", required = false) String brandname,
                                       @ApiParam("维修站ID") @RequestParam(value = "category", required = false) String category,
                                       @ApiParam("维修站名称") @RequestParam(value = "stationId", required = false) Long stationId,
                                       @ApiParam("服务开始时间") @RequestParam(value = "serviceStartTime", required = false) Long serviceStartTime,
                                       @ApiParam("服务结束时间") @RequestParam(value = "serviceEndTime", required = false) Long serviceEndTime,
                                       @ApiParam("开始时间") @RequestParam(value = "startTime", required = false) Long startTime,
                                       @ApiParam("结束时间") @RequestParam(value = "endTime", required = false) Long endTime,
                                       @ApiParam("服务项目") @RequestParam(value = "serviceType", required = false) Long serviceType,
                                       @ApiParam("服务次数") @RequestParam(value = "serviceNum", required = false) Integer serviceNum,
                                       @ApiParam("技术人员ID") @RequestParam(value = "userId", required = false) Long userId,
                                       @ApiParam("是否有待跟进") @RequestParam(value = "isFollowUp", required = false) Boolean iFillin,
                                       @ApiParam("满意度分数") @RequestParam(value = "score", required = false) String scoreType,
                                       @ApiParam("处理状态") @RequestParam(value = "followType", required = false) String followType,
                                       @ApiParam(value = "维修站编号") @RequestParam(value = "stationNum", required = false) String stationNum,
                                       @ApiParam(value = "部门ID") @RequestParam(value = "departmentId", required = false) Long departmentId) throws Exception {
        isUserLogin();
        JsonResponse data = statReport(loginUserId, provinces, brandname, category, stationId, serviceStartTime, serviceEndTime, startTime, endTime, serviceType, serviceNum, userId, iFillin, scoreType, followType, stationNum, departmentId);
        JsonResponse socre = getScore(loginUserId, provinces, brandname, category, stationId, serviceStartTime, serviceEndTime, startTime, endTime, serviceType, serviceNum, userId, iFillin, scoreType, followType, stationNum, departmentId);
        JsonResponse customerData = warningProcessing.getCustomerReport(loginUserId, new PageRequest(0, 100000), provinces, category, brandname, null,
                serviceStartTime, serviceEndTime, startTime, endTime, null, scoreType, null, stationNum, departmentId, "", "", "", "");
        CustomerStatVo customerStatVo = new CustomerStatVo();
        com.ugoodtech.mdcc.core.dto.JsonResponse dataJson = (com.ugoodtech.mdcc.core.dto.JsonResponse) data.getData();
        com.ugoodtech.mdcc.core.dto.JsonResponse scoreJson = (com.ugoodtech.mdcc.core.dto.JsonResponse) socre.getData();
        VstarCustomerSatisfactionReport vstarCustomerSatisfactionReport = (VstarCustomerSatisfactionReport) dataJson.getData();
        customerStatVo.setData(vstarCustomerSatisfactionReport);
        customerStatVo.setSocre((List<String[]>) scoreJson.getData());
        customerStatVo.setResponseKpi(kpiResponse.getKpiResponse());
        String templetPath = request.getSession().getServletContext().getRealPath("");
        //todo 导出EXCEL
        String fileName = "满意度打分分析.xlsx";
        //sheet名
        String sheetName = "满意度调研图表";
        String[][] content = new String[8][7];
        for (int i = 0; i < customerStatVo.getSocre().size(); i++) {
            String[] score = customerStatVo.getSocre().get(i);
            content[i][0] = score[0];
            content[i][1] = score[1] + "(" + score[2] + ")";
            content[i][2] = score[3] + "(" + score[4] + ")";
            content[i][3] = score[5] + "(" + score[6] + ")";
            content[i][4] = score[7] + "(" + score[8] + ")";
            content[i][5] = score[9] + "(" + score[10] + ")";
            content[i][6] = score[11];
        }
        //创建HSSFWorkbook
        XSSFWorkbook wb = getServiceReportExcel(sheetName, content, null, customerStatVo, vstarCustomerSatisfactionReport, customerData);
        //响应到客户端
        try {
            FileOutputStream outputStream = new FileOutputStream(new File(templetPath + "/export/" + fileName));
            wb.write(outputStream);
            outputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
        }


        //导出日志============================================
        try {
            Map<String, Object> searchParams = new HashMap<>();
            searchParams.put("省份", provinces);
            searchParams.put("品牌", brandname);
            searchParams.put("维修站类型", category);
            if (null != stationId) {
                searchParams.put("维修站名称", stationRepository.findOne(stationId).getName());
            }
            if (null != serviceStartTime) {
                searchParams.put("服务开始时间", com.ugoodtech.mdcc.core.utils.DateUtil.formatDate(new Date(serviceStartTime), Constants.DATE_FORMAT));
            }
            if (null != serviceEndTime) {
                searchParams.put("服务结束时间", com.ugoodtech.mdcc.core.utils.DateUtil.formatDate(new Date(serviceEndTime), Constants.DATE_FORMAT));
            }
            if (null != startTime) {
                searchParams.put("开始时间", com.ugoodtech.mdcc.core.utils.DateUtil.formatDate(new Date(startTime), Constants.DATE_FORMAT));
            }
            if (null != endTime) {
                searchParams.put("结束时间", DateUtil.formatDate(new Date(endTime), Constants.DATE_FORMAT));
            }
            if (null != serviceType) {
                QuestionAnswerOption questionAnswerOption = questionAnswerOptionRepository.findOne(serviceType);
                searchParams.put("服务项目", questionAnswerOption.getName());
            }
            if (null != serviceNum && 0 != serviceNum) {
                searchParams.put("服务次数", serviceNum);
            }
            if (null != userId) {
                UserProfile user = userProfileRepository.findByUserId(userId);
                searchParams.put("技术人员", user.getRealName());
            }
            if (null != iFillin) {
                if (iFillin) {
                    searchParams.put("是否有待跟进", "是");
                } else {
                    searchParams.put("是否有待跟进", "否");
                }
            }
            searchParams.put("满意度分数", scoreType);
            searchParams.put("处理状态", followType);
            searchParams.put("维修站编号", stationNum);
            String desc = "筛选了:";
            for (String key : searchParams.keySet()) {
                if (null != searchParams.get(key) && !StringUtils.isEmpty(searchParams.get(key).toString())) {
                    desc += (key + "=>" + searchParams.get(key) + " ,");
                }
            }
            if ("筛选了:".equals(desc)) {
                desc = "";
            }
            Map<String, Object> logData = new HashMap<>();
            logData.put("str", desc);
            userLogService.addUserLog(this.getCurrentUser(), null,
                    LogConstants.operate_type_send_export,
                    LogConstants.business_type_customer_report_statistics, null, logData);
        } catch (Exception e) {
            e.printStackTrace();
        }


        return JsonResponse.successResponseWithData(Constants.v_starServiceUrl + "/export/" + fileName);
//        return JsonResponse.successResponseWithData("http://vr.duluxdesigner.com.cn/export/" + fileName);
//        return JsonResponse.successResponseWithData("http://116.62.64.140:51002/export/" + fileName);
    }

    private String[] titles = {"题目/选项", "100%", "80%", "60%", "40%", "20%", "平均分"};

    //导出Excel表格
    public XSSFWorkbook getServiceReportExcel(String sheetName, String[][] values, XSSFWorkbook workbook, CustomerStatVo customerStatVo,
                                              VstarCustomerSatisfactionReport vstarCustomerSatisfactionReport, JsonResponse customerData)
            throws Exception {
        Double doubleAverage = 0D;
        List<String> svgList = customerStatVo.getResponseKpi();
        // 第一步，创建一个HSSFWorkbook，对应一个Excel文件
        if (workbook == null) {
            workbook = new XSSFWorkbook();
        }

        // 第二步，在workbook中添加一个sheet,对应Excel文件中的sheet
        XSSFSheet sheet = workbook.createSheet(sheetName);
        sheet.setColumnWidth(0, values[0][0].length() * 2 * 256);
        sheet.setColumnWidth(1, values[0][1].length() * 2 * 256);
        sheet.setColumnWidth(2, values[0][2].length() * 2 * 256);
        sheet.setColumnWidth(3, values[0][3].length() * 2 * 256);
        sheet.setColumnWidth(4, values[0][4].length() * 2 * 256);
        sheet.setColumnWidth(5, values[0][5].length() * 2 * 256);
        sheet.setColumnWidth(6, values[0][6].length() * 2 * 256);

        // 第三步，在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
        XSSFRow row1 = sheet.createRow(151);


        // 设置字体
        XSSFFont font = workbook.createFont();
        font.setFontName("微软雅黑");
        font.setFontHeightInPoints((short) 10);
        font.setColor(IndexedColors.WHITE.getIndex());

        XSSFFont font1 = workbook.createFont();
        font1.setFontName("微软雅黑");
        font1.setFontHeightInPoints((short) 11);
        font1.setBold(true);

        XSSFFont font3 = workbook.createFont();
        font3.setFontName("微软雅黑");
        font3.setFontHeightInPoints((short) 16);
        font3.setBold(true);

        // 第四步，创建单元格，并设置值表头 设置表头居中
        XSSFCellStyle titleStyle = workbook.createCellStyle();
        // 创建一个居中格式
        XSSFColor myColor = new XSSFColor(new java.awt.Color(128, 100, 162));
        titleStyle.setFillForegroundColor(myColor);
        titleStyle.setAlignment(HorizontalAlignment.CENTER);
        titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
        titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        titleStyle.setFont(font);
        titleStyle.setBorderLeft(BorderStyle.THIN);
        titleStyle.setLeftBorderColor(myColor);
        titleStyle.setBorderRight(BorderStyle.THIN);
        titleStyle.setRightBorderColor(myColor);
        titleStyle.setBorderTop(BorderStyle.THIN);
        titleStyle.setTopBorderColor(myColor);

        XSSFRow rowIndex39 = sheet.createRow(150);
        XSSFCell editCell1 = rowIndex39.createCell(5);
        XSSFCellStyle titleStyle6 = workbook.createCellStyle();
        titleStyle6.setFont(font3);
        titleStyle6.setAlignment(HorizontalAlignment.CENTER);
        titleStyle6.setVerticalAlignment(VerticalAlignment.CENTER);
        editCell1.setCellStyle(titleStyle6);
        editCell1.setCellValue("技术服务满意度");


        XSSFColor myColor1 = new XSSFColor(new java.awt.Color(228, 223, 236));
        XSSFCellStyle titleStyle2 = workbook.createCellStyle();
        titleStyle2.setAlignment(HorizontalAlignment.CENTER);
        titleStyle2.setVerticalAlignment(VerticalAlignment.CENTER);
        titleStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        titleStyle2.setFillForegroundColor(myColor1);
        titleStyle2.setBorderTop(BorderStyle.THIN);
        titleStyle2.setBorderBottom(BorderStyle.THIN);
        titleStyle2.setBorderRight(BorderStyle.THIN);
        titleStyle2.setTopBorderColor(myColor);
        XSSFFont font2 = workbook.createFont();
        font2.setFontName("微软雅黑");
        font2.setFontHeightInPoints((short) 10);
        titleStyle2.setFont(font2);


        XSSFCellStyle titleStyle3 = workbook.createCellStyle();
        titleStyle3.setAlignment(HorizontalAlignment.CENTER);
        titleStyle3.setVerticalAlignment(VerticalAlignment.CENTER);
        titleStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        titleStyle3.setFillForegroundColor(myColor1);
        titleStyle3.setBorderTop(BorderStyle.THIN);
        titleStyle3.setBorderBottom(BorderStyle.THIN);
        titleStyle3.setBorderRight(BorderStyle.NONE);
        titleStyle3.setTopBorderColor(myColor);
        titleStyle3.setFont(font2);

        XSSFCellStyle titleStyle4 = workbook.createCellStyle();
        titleStyle4.setAlignment(HorizontalAlignment.CENTER);
        titleStyle4.setVerticalAlignment(VerticalAlignment.CENTER);
        titleStyle4.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        titleStyle4.setFillForegroundColor(IndexedColors.WHITE.getIndex());
        titleStyle4.setBorderTop(BorderStyle.THIN);
        titleStyle4.setBorderBottom(BorderStyle.THIN);
        titleStyle4.setBorderRight(BorderStyle.NONE);
        titleStyle4.setTopBorderColor(myColor);
        titleStyle4.setFont(font2);

        XSSFCellStyle titleStyle5 = workbook.createCellStyle();
        titleStyle5.setAlignment(HorizontalAlignment.CENTER);
        titleStyle5.setVerticalAlignment(VerticalAlignment.CENTER);
        titleStyle5.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        titleStyle5.setFillForegroundColor(IndexedColors.WHITE.getIndex());
        titleStyle5.setBorderTop(BorderStyle.THIN);
        titleStyle5.setBorderBottom(BorderStyle.THIN);
        titleStyle5.setBorderRight(BorderStyle.THIN);
        titleStyle5.setTopBorderColor(myColor);
        titleStyle2.setFont(font2);

//        XSSFCellStyle percentageStyle = workbook.createCellStyle();
//        XSSFDataFormat format = workbook.createDataFormat();
//        percentageStyle.setDataFormat(format.getFormat("0.00%"));


        // 声明列对象
        XSSFCell cell = null;
        //创建标题
        for (int i = 0; i < titles.length; i++) {
            cell = row1.createCell(i);
            cell.setCellValue(titles[i]);
            cell.setCellStyle(titleStyle);
        }

        XSSFDataFormat dataFormat = workbook.createDataFormat();
        //创建内容
        XSSFCell cell2 = null;
        for (int i = 0; i < values.length; i++) {
            row1 = sheet.createRow(i + 152);
            for (int j = 0; j < values[i].length; j++) {
                cell2 = row1.createCell(j);
                if (StringUtils.isEmpty(values[i][j])) {
                    continue;
                }
                //将内容按顺序赋给对应的列对象
                if (j == values[i].length - 1) {
                    if (i % 2 == 0) {
                        titleStyle2.setDataFormat(dataFormat.getFormat("#0.00"));
                        cell2.setCellStyle(titleStyle2);

                    } else {
                        titleStyle5.setDataFormat(dataFormat.getFormat("#0.00"));
                        cell2.setCellStyle(titleStyle5);
                    }
                    try {
                        cell2.setCellType(XSSFCell.CELL_TYPE_NUMERIC);
                        cell2.setCellValue(values[i][j]);
                        doubleAverage += Double.valueOf(values[i][j]);
                    } catch (Exception e) {
                        cell2.setCellValue(values[i][j]);
                    }
                } else {
                    if (i % 2 == 0) {
                        cell2.setCellStyle(titleStyle3);
                    } else {
                        cell2.setCellStyle(titleStyle4);
                    }
                    try {
                        cell2.setCellValue(Integer.valueOf(values[i][j]));
                    } catch (Exception e) {
                        cell2.setCellValue(values[i][j]);
                    }
                }
            }
        }

        /**
         * 平均值
         */
        XSSFCell editCell = rowIndex39.createCell(0);
        XSSFCellStyle titleStyle1 = workbook.createCellStyle();
        titleStyle1.setFont(font1);
        editCell.setCellStyle(titleStyle1);
        editCell.setCellValue("该矩阵题平均分：" + doubleGeTowDecimal(doubleAverage / 7));
        sheet.addMergedRegion(new CellRangeAddress(0, 0, 4, 6));


        XSSFRow rowIndex0 = sheet.createRow(0);
        XSSFCell provinces = rowIndex0.createCell(2);
        provinces.setCellStyle(titleStyle6);
        provinces.setCellValue("销售区域");

        XSSFCell customerStat = rowIndex0.createCell(10);
        customerStat.setCellStyle(titleStyle6);
        customerStat.setCellValue("客户状态");

        XSSFCell stationType = rowIndex0.createCell(21);
        stationType.setCellStyle(titleStyle6);
        stationType.setCellValue("维修站类型");

        XSSFRow rowIndex25 = sheet.createRow(33);
        XSSFCell paintBrand = rowIndex25.createCell(3);
        paintBrand.setCellStyle(titleStyle6);
        paintBrand.setCellValue("油漆品牌");

        XSSFCell productPosition = rowIndex25.createCell(16);
        productPosition.setCellStyle(titleStyle6);
        productPosition.setCellValue("品牌定位");

        XSSFRow rowIndex48 = sheet.createRow(70);
        XSSFCell brand = rowIndex48.createCell(3);
        brand.setCellStyle(titleStyle6);
        brand.setCellValue("具体汽车品牌");

        XSSFRow rowIndex84 = sheet.createRow(99);
        XSSFCell serviceType = rowIndex84.createCell(2);
        serviceType.setCellStyle(titleStyle6);
        serviceType.setCellValue("服务项目");

        XSSFCell serviceResult = rowIndex48.createCell(13);
        serviceResult.setCellStyle(titleStyle6);
        serviceResult.setCellValue("服务结果");

        XSSFRow rowIndex107 = sheet.createRow(123);
        XSSFCell serviceResult1 = rowIndex107.createCell(3);
        serviceResult1.setCellStyle(titleStyle6);
        serviceResult1.setCellValue("技术服务满意度");

        XSSFDrawing patriarch = sheet.createDrawingPatriarch();
        try {
            logger.info("svg长度为：" + svgList.size());
            for (int i = 0; i < svgList.size(); i++) {
                ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
                SvgRasterizer.convertToPng(svgList.get(i), byteArrayOut);
                XSSFClientAnchor anchor = null;
                if (i == 3) {
                    //销售区域
                    logger.info("生成销售区域图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 0, 1, (short) 4, 31);
                } else if (i == 4) {
                    //客户状态
                    logger.info("生成客户状态图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 7, 1, (short) 17, 30);
                } else if (i == 0) {
                    //具体汽车品牌
                    logger.info("生成具体汽车品牌图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 0, 71, (short) 4, 95);
                } else if (i == 7) {
                    //油漆品牌
                    logger.info("生成油漆品牌图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 0, 35, (short) 4, 66);
                } else if (i == 8) {
                    //品牌定位
                    logger.info("生成品牌定位图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 7, 34, (short) 17, 63);
                } else if (i == 1) {
                    //服务项目
                    logger.info("生成服务项目图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 0, 100, (short) 3, 119);
                } else if (i == 12) {
                    //服务结果
                    logger.info("生成服务结果图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 7, 71, (short) 17, 101);
                } else if (i == 13) {
                    //维修站类型
                    logger.info("生成维修站类型图表");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 19, 1, (short) 29, 30);
                } else if (i == 2) {
                    //技术服务满意度
                    logger.info("技术服务满意度");
                    anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 0, 124, (short) 4, 148);
                } else {
                    continue;
                }
                try {
                    patriarch.createPicture(anchor, workbook.addPicture(byteArrayOut.toByteArray(), XSSFWorkbook.PICTURE_TYPE_PNG)).resize(1.0);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }


            /**
             * 第二个sheet
             */
            XSSFDataFormat xssfDataFormat = workbook.createDataFormat();

            XSSFSheet sheet1 = workbook.createSheet("满意度调研数据表");
            for (int i = 0; i < 11; i++) {
                sheet1.setColumnWidth(i, 8 * 2 * 256);
            }

            XSSFRow sheet1Row1 = sheet1.createRow(0);
            List<String[]> provinceList = vstarCustomerSatisfactionReport.getProvinceList();
            // 销售省份
            XSSFCell sheet1Cell = null;
            String[] sheet1Provices = {"销售省份", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1Provices.length; i++) {
                sheet1Cell = sheet1Row1.createCell(i);
                sheet1Cell.setCellValue(sheet1Provices[i]);
                sheet1Cell.setCellStyle(titleStyle);
            }

            int countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < provinceList.size(); i++) {
                provinceList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(provinceList.get(i)[1]) / countValue);
            }
            String[] strings = new String[3];
            strings[0] = "有效报告数";
            strings[1] = String.valueOf(countValue);
            strings[2] = "1";
            provinceList.add(strings);

            XSSFCell sheet1Cell2 = null;
            for (int i = 0; i < provinceList.size(); i++) {
                sheet1Row1 = sheet1.createRow(i + 1);
                for (int j = 0; j < provinceList.get(i).length; j++) {
                    sheet1Cell2 = sheet1Row1.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == provinceList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            titleStyle2.setFont(font2);
                            if (j == 2) {
                                doubleValue = Double.valueOf(provinceList.get(i)[j]);
                                titleStyle2.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell2.setCellStyle(titleStyle2);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(provinceList.get(i)[j])) {
                                    doubleValue = Double.valueOf(provinceList.get(i)[j]);
                                    titleStyle5.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            titleStyle5.setFont(font2);
                            sheet1Cell2.setCellStyle(titleStyle5);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell2.setCellValue(doubleValue);
                            } else {
                                sheet1Cell2.setCellValue(Long.valueOf(provinceList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell2.setCellValue(provinceList.get(i)[j]);
                        }
                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(provinceList.get(i)[j]);
                                titleStyle3.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            titleStyle3.setFont(font2);
                            sheet1Cell2.setCellStyle(titleStyle3);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(provinceList.get(i)[j])) {
                                    doubleValue = Double.valueOf(provinceList.get(i)[j]);
                                    titleStyle4.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            titleStyle4.setFont(font2);
                            sheet1Cell2.setCellStyle(titleStyle4);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell2.setCellValue(doubleValue);
                            } else {
                                sheet1Cell2.setCellValue(Long.valueOf(provinceList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell2.setCellValue(provinceList.get(i)[j]);
                        }
                    }
                }
            }

            //客户状态
            XSSFCellStyle sheet1TitleStyle1 = workbook.createCellStyle();
            XSSFColor sheet1MyColor = new XSSFColor(new java.awt.Color(79, 129, 189));
            sheet1TitleStyle1.setFillForegroundColor(sheet1MyColor);
            sheet1TitleStyle1.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle1.setFont(font);
            sheet1TitleStyle1.setBorderLeft(BorderStyle.THIN);
            sheet1TitleStyle1.setLeftBorderColor(sheet1MyColor);
            sheet1TitleStyle1.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle1.setRightBorderColor(sheet1MyColor);
            sheet1TitleStyle1.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle1.setTopBorderColor(sheet1MyColor);

            XSSFColor sheetMyColor1 = new XSSFColor(new java.awt.Color(184, 204, 228));
            XSSFCellStyle sheet1TitleStyle2 = workbook.createCellStyle();
            sheet1TitleStyle2.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle2.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle2.setFillForegroundColor(sheetMyColor1);
            sheet1TitleStyle2.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle2.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle2.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle2.setTopBorderColor(myColor);
            sheet1TitleStyle2.setFont(font2);

            XSSFCellStyle sheet1TitleStyle3 = workbook.createCellStyle();
            sheet1TitleStyle3.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle3.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle3.setFillForegroundColor(sheetMyColor1);
            sheet1TitleStyle3.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle3.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle3.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle3.setTopBorderColor(sheetMyColor1);
            sheet1TitleStyle3.setWrapText(true);
            sheet1TitleStyle3.setFont(font2);

            XSSFColor sheetMyColor2 = new XSSFColor(new java.awt.Color(220, 230, 241));
            XSSFCellStyle sheet1TitleStyle4 = workbook.createCellStyle();
            sheet1TitleStyle4.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle4.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle4.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle4.setFillForegroundColor(sheetMyColor2);
            sheet1TitleStyle4.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle4.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle4.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle4.setTopBorderColor(sheetMyColor1);
            sheet1TitleStyle4.setFont(font2);

            XSSFCellStyle sheet1TitleStyle5 = workbook.createCellStyle();
            sheet1TitleStyle5.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle5.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle5.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle5.setFillForegroundColor(sheetMyColor2);
            sheet1TitleStyle5.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle5.setWrapText(true);
            sheet1TitleStyle5.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle5.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle5.setTopBorderColor(sheetMyColor1);
            sheet1TitleStyle5.setFont(font2);

            XSSFRow sheet1Row2 = sheet1.createRow(provinceList.size() + 4);
            List<String[]> customerStatList = vstarCustomerSatisfactionReport.getCustomerStatList();
            XSSFCell sheet1Cell3 = null;
            String[] sheet1customerStat = {"客户状态", "客户数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1customerStat.length; i++) {
                sheet1Cell3 = sheet1Row2.createCell(i);
                sheet1Cell3.setCellValue(sheet1customerStat[i]);
                sheet1Cell3.setCellStyle(sheet1TitleStyle1);
            }

            countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < customerStatList.size(); i++) {
                customerStatList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(customerStatList.get(i)[1]) / countValue);
            }
            String[] customerCount = new String[3];
            customerCount[0] = "有效报告数";
            customerCount[1] = String.valueOf(countValue);
            customerCount[2] = "1";
            customerStatList.add(customerCount);

            XSSFCell sheet1Cell4 = null;
            for (int i = 0; i < customerStatList.size(); i++) {
                sheet1Row2 = sheet1.createRow(i + provinceList.size() + 5);
                for (int j = 0; j < customerStatList.get(i).length; j++) {
                    sheet1Cell4 = sheet1Row2.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == customerStatList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(customerStatList.get(i)[j]);
                                sheet1TitleStyle2.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell4.setCellStyle(sheet1TitleStyle2);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(customerStatList.get(i)[j])) {
                                    doubleValue = Double.valueOf(customerStatList.get(i)[j]);
                                    sheet1TitleStyle5.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell4.setCellStyle(sheet1TitleStyle5);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell4.setCellValue(doubleValue);
                            } else {
                                sheet1Cell4.setCellValue(Long.valueOf(customerStatList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell4.setCellValue(customerStatList.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(customerStatList.get(i)[j]);
                                sheet1TitleStyle3.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell4.setCellStyle(sheet1TitleStyle3);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(customerStatList.get(i)[j])) {
                                    doubleValue = Double.valueOf(customerStatList.get(i)[j]);
                                    sheet1TitleStyle4.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell4.setCellStyle(sheet1TitleStyle4);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell4.setCellValue(doubleValue);
                            } else {
                                sheet1Cell4.setCellValue(Long.valueOf(customerStatList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell4.setCellValue(customerStatList.get(i)[j]);
                        }
                    }
                }
            }

            //维修站类型
            XSSFCellStyle sheet1TitleStyle6 = workbook.createCellStyle();
            XSSFColor sheet1MyColorStation = new XSSFColor(new java.awt.Color(192, 80, 77));
            sheet1TitleStyle6.setFillForegroundColor(sheet1MyColorStation);
            sheet1TitleStyle6.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle6.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle6.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle6.setFont(font);
            sheet1TitleStyle6.setBorderLeft(BorderStyle.THIN);
            sheet1TitleStyle6.setLeftBorderColor(sheet1MyColorStation);
            sheet1TitleStyle6.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle6.setRightBorderColor(sheet1MyColorStation);
            sheet1TitleStyle6.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle6.setTopBorderColor(sheet1MyColorStation);

            XSSFColor sheetMyColor3 = new XSSFColor(new java.awt.Color(230, 184, 183));
            XSSFCellStyle sheet1TitleStyle22 = workbook.createCellStyle();
            sheet1TitleStyle22.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle22.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle22.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle22.setFillForegroundColor(sheetMyColor3);
            sheet1TitleStyle22.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle22.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle22.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle22.setTopBorderColor(sheetMyColor3);
            sheet1TitleStyle22.setFont(font2);


            XSSFCellStyle sheet1TitleStyle33 = workbook.createCellStyle();
            sheet1TitleStyle33.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle33.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle33.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle33.setFillForegroundColor(sheetMyColor3);
            sheet1TitleStyle33.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle33.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle33.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle33.setTopBorderColor(sheetMyColor3);
            sheet1TitleStyle33.setFont(font2);

            XSSFColor sheetMyColor4 = new XSSFColor(new java.awt.Color(242, 220, 219));
            XSSFCellStyle sheet1TitleStyle44 = workbook.createCellStyle();
            sheet1TitleStyle44.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle44.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle44.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle44.setFillForegroundColor(sheetMyColor4);
            sheet1TitleStyle44.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle44.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle44.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle44.setTopBorderColor(sheetMyColor4);
            sheet1TitleStyle44.setFont(font2);

            XSSFCellStyle sheet1TitleStyle55 = workbook.createCellStyle();
            sheet1TitleStyle55.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle55.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle55.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle55.setFillForegroundColor(sheetMyColor4);
            sheet1TitleStyle55.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle55.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle55.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle55.setTopBorderColor(sheetMyColor4);
            sheet1TitleStyle55.setFont(font2);


            XSSFRow sheet1Row3 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4);
            List<String[]> stationTypeList = vstarCustomerSatisfactionReport.getStationTypelist();
            XSSFCell sheet1Cell6 = null;
            String[] sheet1StationType = {"维修站类型", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1StationType.length; i++) {
                sheet1Cell6 = sheet1Row3.createCell(i);
                sheet1Cell6.setCellValue(sheet1StationType[i]);
                sheet1Cell6.setCellStyle(sheet1TitleStyle6);
            }

            countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < stationTypeList.size(); i++) {
                stationTypeList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(stationTypeList.get(i)[1]) / countValue);
            }
            String[] stationCount = new String[3];
            stationCount[0] = "有效报告数";
            stationCount[1] = String.valueOf(countValue);
            stationCount[2] = "1";
            stationTypeList.add(stationCount);

            XSSFCell sheet1Cell5 = null;
            for (int i = 0; i < stationTypeList.size(); i++) {
                sheet1Row3 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4);
                for (int j = 0; j < stationTypeList.get(i).length; j++) {
                    sheet1Cell5 = sheet1Row3.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == stationTypeList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(stationTypeList.get(i)[j]);
                                sheet1TitleStyle22.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell5.setCellStyle(sheet1TitleStyle22);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(stationTypeList.get(i)[j])) {
                                    doubleValue = Double.valueOf(stationTypeList.get(i)[j]);
                                    sheet1TitleStyle55.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell5.setCellStyle(sheet1TitleStyle55);
                        }
                        if (stationTypeList.get(i)[j].equals("")) {
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell5.setCellValue(doubleValue);
                            } else {
                                sheet1Cell5.setCellValue(Long.valueOf(stationTypeList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell5.setCellValue(stationTypeList.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(stationTypeList.get(i)[j]);
                                sheet1TitleStyle33.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell5.setCellStyle(sheet1TitleStyle33);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(stationTypeList.get(i)[j])) {
                                    doubleValue = Double.valueOf(stationTypeList.get(i)[j]);
                                    sheet1TitleStyle44.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell5.setCellStyle(sheet1TitleStyle44);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell5.setCellValue(doubleValue);
                            } else {
                                sheet1Cell5.setCellValue(Long.valueOf(stationTypeList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell5.setCellValue(stationTypeList.get(i)[j]);
                        }
                    }
                }
            }


            // 油漆品牌
            XSSFCellStyle sheet1TitleStyle7 = workbook.createCellStyle();
            XSSFRow sheet1Row4 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4);
            // 创建一个居中格式
            XSSFColor sheet1Color = new XSSFColor(new java.awt.Color(75, 172, 198));
            sheet1TitleStyle7.setFillForegroundColor(sheet1Color);
            sheet1TitleStyle7.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle7.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle7.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle7.setFont(font);
            sheet1TitleStyle7.setBorderLeft(BorderStyle.THIN);
            sheet1TitleStyle7.setLeftBorderColor(sheet1Color);
            sheet1TitleStyle7.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle7.setRightBorderColor(sheet1Color);
            sheet1TitleStyle7.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle7.setTopBorderColor(sheet1Color);

            XSSFColor sheetMyColor5 = new XSSFColor(new java.awt.Color(184, 204, 228));
            XSSFCellStyle sheet1TitleStyle222 = workbook.createCellStyle();
            sheet1TitleStyle222.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle222.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle222.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle222.setFillForegroundColor(sheetMyColor5);
            sheet1TitleStyle222.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle222.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle222.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle222.setTopBorderColor(sheetMyColor5);
            sheet1TitleStyle222.setFont(font2);


            XSSFCellStyle sheet1TitleStyle333 = workbook.createCellStyle();
            sheet1TitleStyle333.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle333.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle333.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle333.setFillForegroundColor(sheetMyColor5);
            sheet1TitleStyle333.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle333.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle333.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle333.setTopBorderColor(sheetMyColor5);
            sheet1TitleStyle333.setFont(font2);

            XSSFColor sheetMyColor6 = new XSSFColor(new java.awt.Color(220, 230, 241));
            XSSFCellStyle sheet1TitleStyle444 = workbook.createCellStyle();
            sheet1TitleStyle444.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle444.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle444.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle444.setFillForegroundColor(sheetMyColor6);
            sheet1TitleStyle444.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle444.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle444.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle444.setTopBorderColor(sheetMyColor6);
            sheet1TitleStyle444.setFont(font2);

            XSSFCellStyle sheet1TitleStyle555 = workbook.createCellStyle();
            sheet1TitleStyle555.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle555.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle555.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle555.setFillForegroundColor(sheetMyColor6);
            sheet1TitleStyle555.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle555.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle555.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle555.setTopBorderColor(sheetMyColor6);
            sheet1TitleStyle555.setFont(font2);

            List<String[]> paintBrandList = vstarCustomerSatisfactionReport.getPaintBrandList();
            XSSFCell sheet1Cell7 = null;
            String[] sheet1PaintBrand = {"油漆品牌", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1PaintBrand.length; i++) {
                sheet1Cell7 = sheet1Row4.createCell(i);
                sheet1Cell7.setCellValue(sheet1PaintBrand[i]);
                sheet1Cell7.setCellStyle(sheet1TitleStyle7);
            }

            countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < paintBrandList.size(); i++) {
                paintBrandList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(paintBrandList.get(i)[1]) / countValue);
            }
            strings[0] = "有效报告数";
            strings[1] = String.valueOf(countValue);
            strings[2] = "1";
            paintBrandList.add(strings);

            XSSFCell sheet1Cell8 = null;
            for (int i = 0; i < paintBrandList.size(); i++) {
                sheet1Row4 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4);
                for (int j = 0; j < paintBrandList.get(i).length; j++) {
                    sheet1Cell8 = sheet1Row4.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == paintBrandList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(paintBrandList.get(i)[j]);
                                sheet1TitleStyle222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell8.setCellStyle(sheet1TitleStyle222);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(paintBrandList.get(i)[j])) {
                                    doubleValue = Double.valueOf(paintBrandList.get(i)[j]);
                                    sheet1TitleStyle555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell8.setCellStyle(sheet1TitleStyle555);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell8.setCellValue(doubleValue);
                            } else {
                                sheet1Cell8.setCellValue(Long.valueOf(paintBrandList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell8.setCellValue(paintBrandList.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(paintBrandList.get(i)[j]);
                                sheet1TitleStyle333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell8.setCellStyle(sheet1TitleStyle333);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(paintBrandList.get(i)[j])) {
                                    doubleValue = Double.valueOf(paintBrandList.get(i)[j]);
                                    sheet1TitleStyle444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell8.setCellStyle(sheet1TitleStyle444);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell8.setCellValue(doubleValue);
                            } else {
                                sheet1Cell8.setCellValue(Long.valueOf(paintBrandList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell8.setCellValue(paintBrandList.get(i)[j]);
                        }
                    }
                }
            }

            //其他油漆品牌
            List<String[]> otherPaintBrnadList = vstarCustomerSatisfactionReport.getOtherPaintBrandList();
            XSSFRow sheet1Row5 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4 + paintBrandList.size() + 4);
            XSSFCell sheet1Cell9 = null;
            String[] sheet1OtherPaintBrand = {"其他油漆品牌", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1PaintBrand.length; i++) {
                sheet1Cell9 = sheet1Row5.createCell(i);
                sheet1Cell9.setCellValue(sheet1OtherPaintBrand[i]);
                sheet1Cell9.setCellStyle(sheet1TitleStyle7);
            }

            countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < otherPaintBrnadList.size(); i++) {
                otherPaintBrnadList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(otherPaintBrnadList.get(i)[1]) / countValue);
            }
            strings[0] = "有效报告数";
            strings[1] = String.valueOf(countValue);
            strings[2] = "1";
            otherPaintBrnadList.add(strings);

            XSSFCell sheet1Cell10 = null;
            for (int i = 0; i < otherPaintBrnadList.size(); i++) {
                sheet1Row5 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4 + paintBrandList.size() + 4);
                for (int j = 0; j < otherPaintBrnadList.get(i).length; j++) {
                    sheet1Cell10 = sheet1Row5.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == otherPaintBrnadList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(otherPaintBrnadList.get(i)[j]);
                                sheet1TitleStyle222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell10.setCellStyle(sheet1TitleStyle222);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(otherPaintBrnadList.get(i)[j])) {
                                    doubleValue = Double.valueOf(otherPaintBrnadList.get(i)[j]);
                                    sheet1TitleStyle555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell10.setCellStyle(sheet1TitleStyle555);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell10.setCellValue(doubleValue);
                            } else {
                                sheet1Cell10.setCellValue(Long.valueOf(otherPaintBrnadList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell10.setCellValue(otherPaintBrnadList.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(otherPaintBrnadList.get(i)[j]);
                                sheet1TitleStyle333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell10.setCellStyle(sheet1TitleStyle333);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(otherPaintBrnadList.get(i)[j])) {
                                    doubleValue = Double.valueOf(otherPaintBrnadList.get(i)[j]);
                                    sheet1TitleStyle444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell10.setCellStyle(sheet1TitleStyle444);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell10.setCellValue(doubleValue);
                            } else {
                                sheet1Cell10.setCellValue(Long.valueOf(otherPaintBrnadList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell10.setCellValue(otherPaintBrnadList.get(i)[j]);
                        }
                    }
                }
            }

            //维修站具体品牌
            XSSFColor sheet1Color_Brand = new XSSFColor(new java.awt.Color(247, 150, 70));
            XSSFCellStyle sheet1TitleStyle9 = workbook.createCellStyle();
            sheet1TitleStyle9.setFillForegroundColor(sheet1Color_Brand);
            sheet1TitleStyle9.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle9.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle9.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle9.setFont(font);
            sheet1TitleStyle9.setBorderLeft(BorderStyle.THIN);
            sheet1TitleStyle9.setLeftBorderColor(sheet1Color_Brand);
            sheet1TitleStyle9.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle9.setRightBorderColor(sheet1Color_Brand);
            sheet1TitleStyle9.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle9.setTopBorderColor(sheet1Color_Brand);

            XSSFColor sheetMyColor7 = new XSSFColor(new java.awt.Color(252, 213, 180));
            XSSFCellStyle sheet1TitleStyle2222 = workbook.createCellStyle();
            sheet1TitleStyle2222.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle2222.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle2222.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle2222.setFillForegroundColor(sheetMyColor7);
            sheet1TitleStyle2222.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle2222.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle2222.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle2222.setTopBorderColor(sheetMyColor7);
            sheet1TitleStyle2222.setFont(font2);


            XSSFCellStyle sheet1TitleStyle3333 = workbook.createCellStyle();
            sheet1TitleStyle3333.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle3333.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle3333.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle3333.setFillForegroundColor(sheetMyColor7);
            sheet1TitleStyle3333.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle3333.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle3333.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle3333.setTopBorderColor(sheetMyColor7);
            sheet1TitleStyle3333.setFont(font2);

            XSSFColor sheetMyColor8 = new XSSFColor(new java.awt.Color(253, 233, 217));
            XSSFCellStyle sheet1TitleStyle4444 = workbook.createCellStyle();
            sheet1TitleStyle4444.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle4444.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle4444.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle4444.setFillForegroundColor(sheetMyColor8);
            sheet1TitleStyle4444.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle4444.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle4444.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle4444.setTopBorderColor(sheetMyColor8);
            sheet1TitleStyle4444.setFont(font2);

            XSSFCellStyle sheet1TitleStyle5555 = workbook.createCellStyle();
            sheet1TitleStyle5555.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle5555.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle5555.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle5555.setFillForegroundColor(sheetMyColor8);
            sheet1TitleStyle5555.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle5555.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle5555.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle5555.setTopBorderColor(sheetMyColor8);
            sheet1TitleStyle5555.setFont(font2);

            List<String[]> brandArray = vstarCustomerSatisfactionReport.getVstarCustomerSatisfactionReport_brand().getBrandArray();
            XSSFRow sheet1Row6 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                    paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4);
            XSSFCell sheet1Cell11 = null;
            String[] sheet1Brand = {"维修站具体品牌", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1PaintBrand.length; i++) {
                sheet1Cell11 = sheet1Row6.createCell(i);
                sheet1Cell11.setCellValue(sheet1Brand[i]);
                sheet1Cell11.setCellStyle(sheet1TitleStyle9);
            }

            countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < brandArray.size(); i++) {
                brandArray.get(i)[2] = doubleGeTowDecimal(Double.valueOf(brandArray.get(i)[1]) / countValue);
            }
            strings[0] = "有效报告数";
            strings[1] = String.valueOf(countValue);
            strings[2] = "1";
            brandArray.add(strings);

            XSSFCell sheet1Cell12 = null;
            for (int i = 0; i < brandArray.size(); i++) {
                sheet1Row6 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                        paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4);
                for (int j = 0; j < brandArray.get(i).length; j++) {
                    sheet1Cell12 = sheet1Row6.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == brandArray.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(brandArray.get(i)[j]);
                                sheet1TitleStyle2222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell12.setCellStyle(sheet1TitleStyle2222);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(brandArray.get(i)[j])) {
                                    doubleValue = Double.valueOf(brandArray.get(i)[j]);
                                    sheet1TitleStyle5555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell12.setCellStyle(sheet1TitleStyle5555);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell12.setCellValue(doubleValue);
                            } else {
                                sheet1Cell12.setCellValue(Long.valueOf(brandArray.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell12.setCellValue(brandArray.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(brandArray.get(i)[j]);
                                sheet1TitleStyle3333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell12.setCellStyle(sheet1TitleStyle3333);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(brandArray.get(i)[j])) {
                                    doubleValue = Double.valueOf(brandArray.get(i)[j]);
                                    sheet1TitleStyle4444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell12.setCellStyle(sheet1TitleStyle4444);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell12.setCellValue(doubleValue);
                            } else {
                                sheet1Cell12.setCellValue(Long.valueOf(brandArray.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell12.setCellValue(brandArray.get(i)[j]);
                        }
                    }
                }
            }


            //其他维修站品牌
            List<String[]> otherBrandArray = vstarCustomerSatisfactionReport.getVstarCustomerSatisfactionReport_brand().getOtherBrandList();
            if (otherBrandArray != null && otherBrandArray.size() > 0) {
                XSSFRow sheet1Row7 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                        paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4);
                XSSFCell sheet1Cell113 = null;
                String[] sheet1OtherBrand = {"其他维修站具体品牌", "站点数量", "比例"};
                //创建标题
                for (int i = 0; i < sheet1OtherBrand.length; i++) {
                    sheet1Cell113 = sheet1Row7.createCell(i);
                    sheet1Cell113.setCellValue(sheet1OtherBrand[i]);
                    sheet1Cell113.setCellStyle(sheet1TitleStyle9);
                }

                countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
                for (int i = 0; i < otherBrandArray.size(); i++) {
                    otherBrandArray.get(i)[2] = doubleGeTowDecimal(Double.valueOf(otherBrandArray.get(i)[1]) / countValue);
                }
                strings[0] = "有效报告数";
                strings[1] = String.valueOf(countValue);
                strings[2] = "1";
                otherBrandArray.add(strings);

                XSSFCell sheet1Cell14 = null;
                for (int i = 0; i < otherBrandArray.size(); i++) {
                    sheet1Row7 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                            paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4);
                    for (int j = 0; j < otherBrandArray.get(i).length; j++) {
                        sheet1Cell14 = sheet1Row7.createCell(j);
                        //将内容按顺序赋给对应的列对象
                        Double doubleValue = 0D;
                        if (j == otherBrandArray.get(i).length - 1) {
                            if (i % 2 == 0) {
                                if (j == 2) {
                                    doubleValue = Double.valueOf(otherBrandArray.get(i)[j]);
                                    sheet1TitleStyle2222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                                sheet1Cell14.setCellStyle(sheet1TitleStyle2222);
                            } else {
                                if (j == 2) {
                                    if (StringUtils.isNotEmpty(otherBrandArray.get(i)[j])) {
                                        doubleValue = Double.valueOf(otherBrandArray.get(i)[j]);
                                        sheet1TitleStyle5555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                    }
                                }
                                sheet1Cell14.setCellStyle(sheet1TitleStyle5555);
                            }
                            try {
                                if (j == 2) {
                                    sheet1Cell14.setCellValue(doubleValue);
                                } else {
                                    sheet1Cell14.setCellValue(Long.valueOf(otherBrandArray.get(i)[j]));
                                }
                            } catch (Exception e) {
                                sheet1Cell14.setCellValue(otherBrandArray.get(i)[j]);
                            }

                        } else {
                            if (i % 2 == 0) {
                                if (j == 2) {
                                    doubleValue = Double.valueOf(otherBrandArray.get(i)[j]);
                                    sheet1TitleStyle3333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                                sheet1Cell14.setCellStyle(sheet1TitleStyle3333);
                            } else {
                                if (j == 2) {
                                    if (StringUtils.isNotEmpty(otherBrandArray.get(i)[j])) {
                                        doubleValue = Double.valueOf(otherBrandArray.get(i)[j]);
                                        sheet1TitleStyle4444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                    }
                                }
                                sheet1Cell14.setCellStyle(sheet1TitleStyle4444);
                            }
                            try {
                                if (j == 2) {
                                    sheet1Cell14.setCellValue(doubleValue);
                                } else {
                                    sheet1Cell14.setCellValue(Long.valueOf(otherBrandArray.get(i)[j]));
                                }
                            } catch (Exception e) {
                                sheet1Cell14.setCellValue(otherBrandArray.get(i)[j]);
                            }
                        }
                    }
                }
            }

            //品牌定位
            List<String[]> productPositionList = vstarCustomerSatisfactionReport.getProductPositionList();
            XSSFColor sheet1ProductPosition_Color = new XSSFColor(new java.awt.Color(192, 80, 77));
            XSSFCellStyle sheet1TitleStyle10 = workbook.createCellStyle();
            sheet1TitleStyle10.setFillForegroundColor(sheet1ProductPosition_Color);
            sheet1TitleStyle10.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle10.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle10.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle10.setFont(font);
            sheet1TitleStyle10.setBorderLeft(BorderStyle.THIN);
            sheet1TitleStyle10.setLeftBorderColor(sheet1ProductPosition_Color);
            sheet1TitleStyle10.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle10.setRightBorderColor(sheet1ProductPosition_Color);
            sheet1TitleStyle10.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle10.setTopBorderColor(sheet1ProductPosition_Color);

            XSSFColor sheetMyColor9 = new XSSFColor(new java.awt.Color(230, 184, 183));
            XSSFCellStyle sheet1TitleStyle22222 = workbook.createCellStyle();
            sheet1TitleStyle22222.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle22222.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle22222.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle22222.setFillForegroundColor(sheetMyColor9);
            sheet1TitleStyle22222.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle22222.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle22222.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle22222.setTopBorderColor(sheetMyColor9);
            sheet1TitleStyle22222.setFont(font2);


            XSSFCellStyle sheet1TitleStyle33333 = workbook.createCellStyle();
            sheet1TitleStyle33333.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle33333.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle33333.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle33333.setFillForegroundColor(sheetMyColor9);
            sheet1TitleStyle33333.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle33333.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle33333.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle33333.setTopBorderColor(sheetMyColor9);
            sheet1TitleStyle33333.setFont(font2);

            XSSFColor sheetMyColor10 = new XSSFColor(new java.awt.Color(253, 233, 217));
            XSSFCellStyle sheet1TitleStyle44444 = workbook.createCellStyle();
            sheet1TitleStyle44444.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle44444.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle44444.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle44444.setFillForegroundColor(sheetMyColor10);
            sheet1TitleStyle44444.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle44444.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle44444.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle44444.setTopBorderColor(sheetMyColor10);
            sheet1TitleStyle44444.setFont(font2);

            XSSFCellStyle sheet1TitleStyle55555 = workbook.createCellStyle();
            sheet1TitleStyle55555.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle55555.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle55555.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle55555.setFillForegroundColor(sheetMyColor10);
            sheet1TitleStyle55555.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle55555.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle55555.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle55555.setTopBorderColor(sheetMyColor10);
            sheet1TitleStyle55555.setFont(font2);

            XSSFRow sheet1Row8 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                    paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4);
            XSSFCell sheet1Cell114 = null;
            String[] sheet1ProductPosition = {"品牌定位", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1ProductPosition.length; i++) {
                sheet1Cell114 = sheet1Row8.createCell(i);
                sheet1Cell114.setCellValue(sheet1ProductPosition[i]);
                sheet1Cell114.setCellStyle(sheet1TitleStyle10);
            }

            countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < productPositionList.size(); i++) {
                productPositionList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(productPositionList.get(i)[1]) / countValue);
            }
            strings[0] = "有效报告数";
            strings[1] = String.valueOf(countValue);
            strings[2] = "1";
            productPositionList.add(strings);

            XSSFCell sheet1Cell15 = null;
            for (int i = 0; i < productPositionList.size(); i++) {
                sheet1Row8 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                        paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4);
                for (int j = 0; j < productPositionList.get(i).length; j++) {
                    sheet1Cell15 = sheet1Row8.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == productPositionList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(productPositionList.get(i)[j]);
                                sheet1TitleStyle22222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell15.setCellStyle(sheet1TitleStyle22222);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(productPositionList.get(i)[j])) {
                                    doubleValue = Double.valueOf(productPositionList.get(i)[j]);
                                    sheet1TitleStyle55555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell15.setCellStyle(sheet1TitleStyle55555);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell15.setCellValue(doubleValue);
                            } else {
                                sheet1Cell15.setCellValue(Long.valueOf(productPositionList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell15.setCellValue(productPositionList.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(productPositionList.get(i)[j]);
                                sheet1TitleStyle33333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell15.setCellStyle(sheet1TitleStyle33333);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(productPositionList.get(i)[j])) {
                                    doubleValue = Double.valueOf(productPositionList.get(i)[j]);
                                    sheet1TitleStyle44444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell15.setCellStyle(sheet1TitleStyle44444);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell15.setCellValue(doubleValue);
                            } else {
                                sheet1Cell15.setCellValue(Long.valueOf(productPositionList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell15.setCellValue(productPositionList.get(i)[j]);
                        }
                    }
                }
            }

            // 服务项目
            List<String[]> serviceTypeList = vstarCustomerSatisfactionReport.getVstarServiceReport_Target().getTarget();
            XSSFColor sheet1ServiceType_Color = new XSSFColor(new java.awt.Color(155, 187, 89));
            XSSFCellStyle sheet1TitleStyle11 = workbook.createCellStyle();
            sheet1TitleStyle11.setFillForegroundColor(sheet1ServiceType_Color);
            sheet1TitleStyle11.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle11.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle11.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle11.setFont(font);
            sheet1TitleStyle11.setBorderLeft(BorderStyle.THIN);
            sheet1TitleStyle11.setLeftBorderColor(sheet1ServiceType_Color);
            sheet1TitleStyle11.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle11.setRightBorderColor(sheet1ServiceType_Color);
            sheet1TitleStyle11.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle11.setTopBorderColor(sheet1ServiceType_Color);

            XSSFColor sheetMyColor11 = new XSSFColor(new java.awt.Color(216, 228, 188));
            XSSFCellStyle sheet1TitleStyle222222 = workbook.createCellStyle();
            sheet1TitleStyle222222.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle222222.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle222222.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle222222.setFillForegroundColor(sheetMyColor11);
            sheet1TitleStyle222222.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle222222.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle222222.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle222222.setTopBorderColor(sheetMyColor11);
            sheet1TitleStyle222222.setFont(font2);


            XSSFCellStyle sheet1TitleStyle333333 = workbook.createCellStyle();
            sheet1TitleStyle333333.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle333333.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle333333.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle333333.setFillForegroundColor(sheetMyColor11);
            sheet1TitleStyle333333.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle333333.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle333333.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle333333.setTopBorderColor(sheetMyColor11);
            sheet1TitleStyle333333.setFont(font2);

            XSSFColor sheetMyColor12 = new XSSFColor(new java.awt.Color(235, 241, 222));
            XSSFCellStyle sheet1TitleStyle444444 = workbook.createCellStyle();
            sheet1TitleStyle444444.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle444444.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle444444.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle444444.setFillForegroundColor(sheetMyColor12);
            sheet1TitleStyle444444.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle444444.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle444444.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle444444.setTopBorderColor(sheetMyColor12);
            sheet1TitleStyle444444.setFont(font2);

            XSSFCellStyle sheet1TitleStyle555555 = workbook.createCellStyle();
            sheet1TitleStyle555555.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle555555.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle555555.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle555555.setFillForegroundColor(sheetMyColor12);
            sheet1TitleStyle555555.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle555555.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle555555.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle555555.setTopBorderColor(sheetMyColor12);
            sheet1TitleStyle555555.setFont(font2);

            XSSFRow sheet1Row10 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                    paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4 + productPositionList.size() + 4);
            XSSFCell sheet1Cell115 = null;
            String[] sheet1Service = {"具体服务项目", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1Service.length; i++) {
                sheet1Cell115 = sheet1Row10.createCell(i);
                sheet1Cell115.setCellValue(sheet1Service[i]);
                sheet1Cell115.setCellStyle(sheet1TitleStyle11);
            }

            countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
            for (int i = 0; i < serviceTypeList.size(); i++) {
                serviceTypeList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(serviceTypeList.get(i)[1]) / countValue);
            }
            strings[0] = "有效报告数";
            strings[1] = String.valueOf(countValue);
            strings[2] = "1";
            serviceTypeList.add(strings);

            XSSFCell sheet1Cell16 = null;
            for (int i = 0; i < serviceTypeList.size(); i++) {
                sheet1Row10 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                        paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4 + productPositionList.size() + 4);
                for (int j = 0; j < serviceTypeList.get(i).length; j++) {
                    sheet1Cell16 = sheet1Row10.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == serviceTypeList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(serviceTypeList.get(i)[j]);
                                sheet1TitleStyle222222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell16.setCellStyle(sheet1TitleStyle222222);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(serviceTypeList.get(i)[j])) {
                                    doubleValue = Double.valueOf(serviceTypeList.get(i)[j]);
                                    sheet1TitleStyle555555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell16.setCellStyle(sheet1TitleStyle555555);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell16.setCellValue(doubleValue);
                            } else {
                                sheet1Cell16.setCellValue(Long.valueOf(serviceTypeList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell16.setCellValue(serviceTypeList.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(serviceTypeList.get(i)[j]);
                                sheet1TitleStyle333333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell16.setCellStyle(sheet1TitleStyle333333);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(serviceTypeList.get(i)[j])) {
                                    doubleValue = Double.valueOf(serviceTypeList.get(i)[j]);
                                    sheet1TitleStyle444444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell16.setCellStyle(sheet1TitleStyle444444);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell16.setCellValue(doubleValue);
                            } else {
                                sheet1Cell16.setCellValue(Long.valueOf(serviceTypeList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell16.setCellValue(serviceTypeList.get(i)[j]);
                        }
                    }
                }
            }

            // 其他服务项目
            List<String[]> otherServiceTypeList = vstarCustomerSatisfactionReport.getVstarServiceReport_Target().getOtherTarget();
            XSSFRow sheet1Row11 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                    paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4 + productPositionList.size() + 4 + serviceTypeList.size() + 4);
            XSSFCell sheet1Cell116 = null;
            String[] sheet1OtherService = {"客户名称", "客户编号", "日期", "服务项目", "外勤人员", "比例"};
            if (!otherServiceTypeList.isEmpty()) {
                //创建标题
                for (int i = 0; i < sheet1OtherService.length; i++) {
                    sheet1Cell116 = sheet1Row11.createCell(i);
                    sheet1Cell116.setCellValue(sheet1OtherService[i]);
                    sheet1Cell116.setCellStyle(sheet1TitleStyle11);
                }
                countValue = vstarCustomerSatisfactionReport.getCountPerson();
//            for (int i = 0; i < provinceList.size(); i++) {
//                countValue += Integer.valueOf(provinceList.get(i)[1]);
//            }
                for (int i = 0; i < otherServiceTypeList.size(); i++) {
                    otherServiceTypeList.get(i)[5] = doubleGeTowDecimal(Double.valueOf(otherServiceTypeList.size()) / countValue);
                }
                strings = new String[6];
                strings[0] = "有效报告数";
                strings[1] = String.valueOf(countValue);
                strings[2] = "";
                strings[3] = "";
                strings[4] = "";
                strings[5] = "1";
                otherServiceTypeList.add(strings);

                XSSFCell sheet1Cell17 = null;
                for (int i = 0; i < otherServiceTypeList.size(); i++) {
                    sheet1Row11 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                            paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4 + productPositionList.size() + 4 + serviceTypeList.size() + 4);
                    for (int j = 0; j < otherServiceTypeList.get(i).length; j++) {
                        sheet1Cell17 = sheet1Row11.createCell(j);
                        //将内容按顺序赋给对应的列对象
                        Double doubleValue = 0D;
                        if (j == otherServiceTypeList.get(i).length - 1) {
                            if (i % 2 == 0) {
                                if (j == 5) {
                                    doubleValue = Double.valueOf(otherServiceTypeList.get(i)[j]);
                                    sheet1TitleStyle222222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                                sheet1Cell17.setCellStyle(sheet1TitleStyle222222);
                            } else {
                                if (j == 5) {
                                    if (StringUtils.isNotEmpty(otherServiceTypeList.get(i)[j])) {
                                        doubleValue = Double.valueOf(otherServiceTypeList.get(i)[j]);
                                        sheet1TitleStyle555555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                    }
                                }
                                sheet1Cell17.setCellStyle(sheet1TitleStyle555555);
                            }
                            try {
                                if (j == 5) {
                                    sheet1Cell17.setCellValue(doubleValue);
                                } else {
                                    sheet1Cell17.setCellValue(Long.valueOf(otherServiceTypeList.get(i)[j]));
                                }
                            } catch (Exception e) {
                                sheet1Cell17.setCellValue(otherServiceTypeList.get(i)[j]);
                            }

                        } else {
                            if (i % 2 == 0) {
                                if (j == 5) {
                                    doubleValue = Double.valueOf(otherServiceTypeList.get(i)[j]);
                                    sheet1TitleStyle333333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                                sheet1Cell17.setCellStyle(sheet1TitleStyle333333);
                            } else {
                                if (j == 5) {
                                    if (StringUtils.isNotEmpty(otherServiceTypeList.get(i)[j])) {
                                        doubleValue = Double.valueOf(otherServiceTypeList.get(i)[j]);
                                        sheet1TitleStyle444444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                    }
                                }
                                sheet1Cell17.setCellStyle(sheet1TitleStyle444444);
                            }
                            try {
                                if (j == 5) {
                                    sheet1Cell17.setCellValue(doubleValue);
                                } else {
                                    sheet1Cell17.setCellValue(Long.valueOf(otherServiceTypeList.get(i)[j]));
                                }
                            } catch (Exception e) {
                                sheet1Cell17.setCellValue(otherServiceTypeList.get(i)[j]);
                            }
                        }
                    }
                }
            }


            //服务结果
            XSSFColor sheet1Result_Color = new XSSFColor(new java.awt.Color(128, 100, 162));
            XSSFCellStyle sheet1TitleStyle12 = workbook.createCellStyle();
            sheet1TitleStyle12.setFillForegroundColor(sheet1Result_Color);
            sheet1TitleStyle12.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle12.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle12.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle12.setFont(font);
            sheet1TitleStyle12.setBorderLeft(BorderStyle.THIN);
            sheet1TitleStyle12.setLeftBorderColor(sheet1Result_Color);
            sheet1TitleStyle12.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle12.setRightBorderColor(sheet1Result_Color);
            sheet1TitleStyle12.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle12.setTopBorderColor(sheet1Result_Color);

            XSSFColor sheetMyColor13 = new XSSFColor(new java.awt.Color(204, 192, 218));
            XSSFCellStyle sheet1TitleStyle2222222 = workbook.createCellStyle();
            sheet1TitleStyle2222222.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle2222222.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle2222222.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle2222222.setFillForegroundColor(sheetMyColor13);
            sheet1TitleStyle2222222.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle2222222.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle2222222.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle2222222.setTopBorderColor(sheetMyColor13);
            sheet1TitleStyle2222222.setFont(font2);


            XSSFCellStyle sheet1TitleStyle3333333 = workbook.createCellStyle();
            sheet1TitleStyle3333333.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle3333333.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle3333333.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle3333333.setFillForegroundColor(sheetMyColor13);
            sheet1TitleStyle3333333.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle3333333.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle3333333.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle3333333.setTopBorderColor(sheetMyColor13);
            sheet1TitleStyle3333333.setFont(font2);

            XSSFColor sheetMyColor14 = new XSSFColor(new java.awt.Color(228, 223, 236));
            XSSFCellStyle sheet1TitleStyle4444444 = workbook.createCellStyle();
            sheet1TitleStyle4444444.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle4444444.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle4444444.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle4444444.setFillForegroundColor(sheetMyColor14);
            sheet1TitleStyle4444444.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle4444444.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle4444444.setBorderRight(BorderStyle.NONE);
            sheet1TitleStyle4444444.setTopBorderColor(sheetMyColor14);
            sheet1TitleStyle4444444.setFont(font2);

            XSSFCellStyle sheet1TitleStyle5555555 = workbook.createCellStyle();
            sheet1TitleStyle5555555.setAlignment(HorizontalAlignment.CENTER);
            sheet1TitleStyle5555555.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet1TitleStyle5555555.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet1TitleStyle5555555.setFillForegroundColor(sheetMyColor14);
            sheet1TitleStyle5555555.setBorderTop(BorderStyle.THIN);
            sheet1TitleStyle5555555.setBorderBottom(BorderStyle.THIN);
            sheet1TitleStyle5555555.setBorderRight(BorderStyle.THIN);
            sheet1TitleStyle5555555.setTopBorderColor(sheetMyColor14);
            sheet1TitleStyle5555555.setFont(font2);

            List<String[]> resultList = new ArrayList<>();
            Integer complete = customerStatVo.getData().getReport_results().getComplete();
            String[] str = new String[3];
            str[0] = "已完成";
            str[1] = complete.toString();
            str[2] = "";
            resultList.add(str);
            Integer complete_NeedOthersToFollowUp = customerStatVo.getData().getReport_results().getComplete_NeedOthersToFollowUp();
            str = new String[3];
            str[0] = "已完成，但需其他部门跟进";
            str[1] = complete_NeedOthersToFollowUp.toString();
            str[2] = "";
            resultList.add(str);
            Integer noComplete_NeedToFollowUp = customerStatVo.getData().getReport_results().getNoComplete_NeedToFollowUp();
            str = new String[3];
            str[0] = "没有完成，需后续跟进";
            str[1] = noComplete_NeedToFollowUp.toString();
            str[2] = "";
            resultList.add(str);
            Integer noComplete_UnableToFollowUp = customerStatVo.getData().getReport_results().getNoComplete_UnableToFollowUp();
            str = new String[3];
            str[0] = "没有完成，无法后续跟进";
            str[1] = noComplete_UnableToFollowUp.toString();
            str[2] = "";
            resultList.add(str);
            Integer manageProductCount = customerStatVo.getData().getReport_results().getManageProductNum();
            str = new String[3];
            str[0] = "处理产品问题（投诉）";
            str[1] = manageProductCount.toString();
            str[2] = "";
            resultList.add(str);
            Integer planReport = customerStatVo.getData().getReport_results().getPlan();
            str = new String[3];
            str[0] = "计划进行该项工作，尚未开展";
            str[1] = planReport.toString();
            str[2] = "";
            resultList.add(str);


            XSSFRow sheet1Row12 = sheet1.createRow(provinceList.size() + 4 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                    paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4 + productPositionList.size() + 4 + serviceTypeList.size() + 4 + otherServiceTypeList.size() + 4);
            XSSFCell sheet1Cell117 = null;
            String[] sheet1Result = {"服务结果", "站点数量", "比例"};
            //创建标题
            for (int i = 0; i < sheet1Result.length; i++) {
                sheet1Cell117 = sheet1Row12.createCell(i);
                sheet1Cell117.setCellValue(sheet1Result[i]);
                sheet1Cell117.setCellStyle(sheet1TitleStyle12);
            }

            int resultCount = customerStatVo.getData().getCountPerson();
            for (int i = 0; i < resultList.size(); i++) {
                resultList.get(i)[2] = doubleGeTowDecimal(Double.valueOf(resultList.get(i)[1]) / resultCount);
            }
            strings = new String[3];
            strings[0] = "有效报告数";
            strings[1] = String.valueOf(resultCount);
            strings[2] = "1";
            resultList.add(strings);

            XSSFCell sheet1Cell18 = null;
            for (int i = 0; i < resultList.size(); i++) {
                sheet1Row12 = sheet1.createRow(i + provinceList.size() + 5 + customerStatList.size() + 4 + stationTypeList.size() + 4 +
                        paintBrandList.size() + 4 + otherPaintBrnadList.size() + 4 + brandArray.size() + 4 + otherBrandArray.size() + 4
                        + productPositionList.size() + 4 + serviceTypeList.size() + 4 + otherServiceTypeList.size() + 4);
                for (int j = 0; j < resultList.get(i).length; j++) {
                    sheet1Cell18 = sheet1Row12.createCell(j);
                    //将内容按顺序赋给对应的列对象
                    Double doubleValue = 0D;
                    if (j == resultList.get(i).length - 1) {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(resultList.get(i)[j]);
                                sheet1TitleStyle2222222.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell18.setCellStyle(sheet1TitleStyle2222222);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(resultList.get(i)[j])) {
                                    doubleValue = Double.valueOf(resultList.get(i)[j]);
                                    sheet1TitleStyle5555555.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell18.setCellStyle(sheet1TitleStyle5555555);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell18.setCellValue(doubleValue);
                            } else {
                                sheet1Cell18.setCellValue(Long.valueOf(resultList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell18.setCellValue(resultList.get(i)[j]);
                        }

                    } else {
                        if (i % 2 == 0) {
                            if (j == 2) {
                                doubleValue = Double.valueOf(resultList.get(i)[j]);
                                sheet1TitleStyle3333333.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                            }
                            sheet1Cell18.setCellStyle(sheet1TitleStyle3333333);
                        } else {
                            if (j == 2) {
                                if (StringUtils.isNotEmpty(resultList.get(i)[j])) {
                                    doubleValue = Double.valueOf(resultList.get(i)[j]);
                                    sheet1TitleStyle4444444.setDataFormat(xssfDataFormat.getFormat("0.00%"));
                                }
                            }
                            sheet1Cell18.setCellStyle(sheet1TitleStyle4444444);
                        }
                        try {
                            if (j == 2) {
                                sheet1Cell18.setCellValue(doubleValue);
                            } else {
                                sheet1Cell18.setCellValue(Long.valueOf(resultList.get(i)[j]));
                            }
                        } catch (Exception e) {
                            sheet1Cell18.setCellValue(resultList.get(i)[j]);
                        }
                    }
                }
            }


            /**
             * 第三个sheet
             */
            XSSFSheet sheet2 = workbook.createSheet("满意度具体打分总表");
            XSSFDataFormat df = workbook.createDataFormat(); // 此处设置数据格式

            XSSFCellStyle sheet3Style = workbook.createCellStyle();
            sheet3Style.setAlignment(HorizontalAlignment.CENTER);
            sheet3Style.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet3Style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet3Style.setFillForegroundColor(sheetMyColor1);
            sheet3Style.setBorderTop(BorderStyle.THIN);
            sheet3Style.setBorderBottom(BorderStyle.THIN);
            sheet3Style.setBorderRight(BorderStyle.NONE);
            sheet3Style.setTopBorderColor(sheetMyColor1);
            sheet3Style.setWrapText(true);
            sheet3Style.setFont(font2);
            sheet3Style.setDataFormat(df.getFormat("##0"));

            XSSFCellStyle sheet3Style2 = workbook.createCellStyle();
            sheet3Style2.setAlignment(HorizontalAlignment.CENTER);
            sheet3Style2.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet3Style2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet3Style2.setFillForegroundColor(sheetMyColor2);
            sheet3Style2.setBorderTop(BorderStyle.THIN);
            sheet3Style2.setWrapText(true);
            sheet3Style2.setBorderBottom(BorderStyle.THIN);
            sheet3Style2.setBorderRight(BorderStyle.NONE);
            sheet3Style2.setTopBorderColor(sheetMyColor1);
            sheet3Style2.setFont(font2);
            sheet3Style2.setDataFormat(df.getFormat("##0"));

            for (int i = 0; i < 19; i++) {
//                if (i == 6) {
//                    continue;
//                }
                sheet2.autoSizeColumn(i, true);
                sheet2.setColumnWidth(i, 15 * 2 * 256);
            }
            sheet2.setColumnWidth(20, 45 * 2 * 256);

            List<CustomerStatResponse> customerList = (List<CustomerStatResponse>) customerData.getData();
            XSSFRow sheet2Row1 = sheet2.createRow(0);
            XSSFCell sheet2Cell1 = null;
            String[] sheet2CustomerTitle = {"服务人员", "站点名称", "省份", "客户代码", "客户状态", "客户类型", "具体品牌", "油漆服务商", "服务开始时间", "服务结束时间", "服务项目", "服务结果", "服务人员自我评估", "客户名称", "客户职位", "联系方式", "收到短信提醒时间",
                    "客户提交打分时间", "总分", "第一题", "第二题", "第三题", "第四题", "第五题", "第六题", "第七题", "满意度调研反馈情况"};
            //创建标题
            for (int i = 0; i < sheet2CustomerTitle.length; i++) {
                sheet2Cell1 = sheet2Row1.createCell(i);
                sheet2Cell1.setCellValue(sheet2CustomerTitle[i]);
                sheet2Cell1.setCellStyle(sheet1TitleStyle1);
            }

            XSSFColor sheet3Color1 = new XSSFColor(new java.awt.Color(180, 198, 231));
            XSSFCellStyle sheet3InfoStyle2 = workbook.createCellStyle();
            sheet3InfoStyle2.setAlignment(HorizontalAlignment.CENTER);
            sheet3InfoStyle2.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet3InfoStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet3InfoStyle2.setFillForegroundColor(sheet3Color1);
            sheet3InfoStyle2.setBorderTop(BorderStyle.THIN);
            sheet3InfoStyle2.setBorderBottom(BorderStyle.THIN);
            sheet3InfoStyle2.setBorderRight(BorderStyle.THIN);
            sheet3InfoStyle2.setTopBorderColor(sheet3Color1);

            XSSFCellStyle sheet3InfoStyle3 = workbook.createCellStyle();
            sheet3InfoStyle3.setAlignment(HorizontalAlignment.CENTER);
            sheet3InfoStyle3.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet3InfoStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet3InfoStyle3.setFillForegroundColor(myColor1);
            sheet3InfoStyle3.setBorderTop(BorderStyle.THIN);
            sheet3InfoStyle3.setBorderBottom(BorderStyle.THIN);
            sheet3InfoStyle3.setBorderRight(BorderStyle.NONE);
            sheet3InfoStyle3.setTopBorderColor(myColor1);
            sheet3InfoStyle3.setFont(font2);

            XSSFColor sheet3Color2 = new XSSFColor(new java.awt.Color(217, 225, 242));
            XSSFCellStyle sheet3InfoStyle4 = workbook.createCellStyle();
            sheet3InfoStyle4.setAlignment(HorizontalAlignment.CENTER);
            sheet3InfoStyle4.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet3InfoStyle4.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet3InfoStyle4.setFillForegroundColor(sheet3Color2);
            sheet3InfoStyle4.setBorderTop(BorderStyle.THIN);
            sheet3InfoStyle4.setBorderBottom(BorderStyle.THIN);
            sheet3InfoStyle4.setBorderRight(BorderStyle.NONE);
            sheet3InfoStyle4.setTopBorderColor(sheet3Color2);
            sheet3InfoStyle4.setFont(font2);

            XSSFCellStyle sheet3InfoStyle5 = workbook.createCellStyle();
            sheet3InfoStyle5.setAlignment(HorizontalAlignment.CENTER);
            sheet3InfoStyle5.setVerticalAlignment(VerticalAlignment.CENTER);
            sheet3InfoStyle5.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            sheet3InfoStyle5.setFillForegroundColor(sheet3Color2);
            sheet3InfoStyle5.setBorderTop(BorderStyle.THIN);
            sheet3InfoStyle5.setBorderBottom(BorderStyle.THIN);
            sheet3InfoStyle5.setBorderRight(BorderStyle.THIN);
            sheet3InfoStyle5.setTopBorderColor(sheet3Color2);
            sheet3InfoStyle5.setFont(font2);

            for (int i = 0; i < customerList.size(); i++) {
                CustomerStatResponse report = customerList.get(i);
                sheet2Row1 = sheet2.createRow(i + 1);
//                String conetent = report.getManageNote().replaceAll("<[^>]+>", "\n");
//                float hieght = getExcelCellAutoHeight(conetent, conetent.length());
//                sheet2Row1.setHeightInPoints(hieght);
                XSSFCell cell00 = sheet2Row1.createCell(0);
                XSSFCell cell01 = sheet2Row1.createCell(1);
                XSSFCell cell02 = sheet2Row1.createCell(2);
                XSSFCell cell03 = sheet2Row1.createCell(3);
                XSSFCell cell04 = sheet2Row1.createCell(4);
                XSSFCell cell05 = sheet2Row1.createCell(5);
                XSSFCell cell06 = sheet2Row1.createCell(6);
                XSSFCell cell07 = sheet2Row1.createCell(7);
                XSSFCell cell08 = sheet2Row1.createCell(8);
                XSSFCell cell09 = sheet2Row1.createCell(9);
                XSSFCell cell10 = sheet2Row1.createCell(10);
                XSSFCell cell11 = sheet2Row1.createCell(11);
                XSSFCell cell12 = sheet2Row1.createCell(12);
                XSSFCell cell13 = sheet2Row1.createCell(13);
                XSSFCell cell14 = sheet2Row1.createCell(14);
                XSSFCell cell15 = sheet2Row1.createCell(15);
                XSSFCell cell16 = sheet2Row1.createCell(16);
                XSSFCell cell17 = sheet2Row1.createCell(17);
                XSSFCell cell18 = sheet2Row1.createCell(18);
                XSSFCell cell19 = sheet2Row1.createCell(19);
                XSSFCell cell20 = sheet2Row1.createCell(20);
                XSSFCell cell21 = sheet2Row1.createCell(21);
                XSSFCell cell22 = sheet2Row1.createCell(22);
                XSSFCell cell23 = sheet2Row1.createCell(23);
                XSSFCell cell24 = sheet2Row1.createCell(24);
                XSSFCell cell25 = sheet2Row1.createCell(25);
                XSSFCell cell26 = sheet2Row1.createCell(26);

                if (i % 2 == 0) {
                    cell00.setCellStyle(sheet3InfoStyle2);
                    cell01.setCellStyle(sheet3InfoStyle2);
                    cell02.setCellStyle(sheet3InfoStyle2);
                    cell03.setCellStyle(sheet3InfoStyle2);
                    cell04.setCellStyle(sheet3InfoStyle2);
                    cell05.setCellStyle(sheet3InfoStyle2);
                    cell06.setCellStyle(sheet3InfoStyle2);
                    cell07.setCellStyle(sheet3InfoStyle2);
                    cell08.setCellStyle(sheet3InfoStyle2);
                    cell09.setCellStyle(sheet3InfoStyle2);
                    cell10.setCellStyle(sheet3InfoStyle2);
                    cell11.setCellStyle(sheet3InfoStyle2);
                    cell12.setCellStyle(sheet3InfoStyle2);
                    cell13.setCellStyle(sheet3InfoStyle2);
                    cell14.setCellStyle(sheet3InfoStyle2);
                    cell15.setCellStyle(sheet3InfoStyle2);
                    cell16.setCellStyle(sheet3InfoStyle2);
                    cell17.setCellStyle(sheet3InfoStyle2);
                    cell18.setCellStyle(sheet3InfoStyle2);
                    cell19.setCellStyle(sheet3InfoStyle2);
                    cell20.setCellStyle(sheet3InfoStyle2);
                    cell21.setCellStyle(sheet3InfoStyle2);
                    cell22.setCellStyle(sheet3InfoStyle2);
                    cell23.setCellStyle(sheet3InfoStyle2);
                    cell24.setCellStyle(sheet3InfoStyle2);
                    cell25.setCellStyle(sheet3InfoStyle2);
                    cell26.setCellStyle(sheet3InfoStyle2);
                } else {
                    cell00.setCellStyle(sheet3InfoStyle4);
                    cell01.setCellStyle(sheet3InfoStyle4);
                    cell02.setCellStyle(sheet3InfoStyle4);
                    cell03.setCellStyle(sheet3InfoStyle4);
                    cell04.setCellStyle(sheet3InfoStyle4);
                    cell05.setCellStyle(sheet3InfoStyle4);
                    cell06.setCellStyle(sheet3InfoStyle4);
                    cell07.setCellStyle(sheet3InfoStyle4);
                    cell08.setCellStyle(sheet3InfoStyle4);
                    cell09.setCellStyle(sheet3InfoStyle4);
                    cell10.setCellStyle(sheet3InfoStyle4);
                    cell11.setCellStyle(sheet3InfoStyle4);
                    cell12.setCellStyle(sheet3InfoStyle4);
                    cell13.setCellStyle(sheet3InfoStyle4);
                    cell14.setCellStyle(sheet3InfoStyle4);
                    cell15.setCellStyle(sheet3InfoStyle4);
                    cell16.setCellStyle(sheet3InfoStyle4);
                    cell17.setCellStyle(sheet3InfoStyle4);
                    cell18.setCellStyle(sheet3InfoStyle4);
                    cell19.setCellStyle(sheet3InfoStyle4);
                    cell20.setCellStyle(sheet3InfoStyle4);
                    cell21.setCellStyle(sheet3InfoStyle4);
                    cell22.setCellStyle(sheet3InfoStyle4);
                    cell23.setCellStyle(sheet3InfoStyle4);
                    cell24.setCellStyle(sheet3InfoStyle4);
                    cell25.setCellStyle(sheet3InfoStyle4);
                    cell26.setCellStyle(sheet3InfoStyle4);
                }
                String value = "";
                cell00.setCellValue(report.getUserName());
                cell01.setCellValue(report.getStationName());
                cell02.setCellValue(report.getProvice());
                cell03.setCellValue(report.getStationNum());
                cell04.setCellValue(report.getStationStatus());
                cell05.setCellValue(report.getStationType());
                cell06.setCellValue(report.getBrand());
                cell07.setCellValue(report.getPaintService());


                cell08.setCellValue(report.getServiceStartTime());
                cell09.setCellValue(report.getServiceEndTime());
                cell10.setCellValue(report.getServiceType());
                cell11.setCellValue(report.getServiceStat());
                cell12.setCellValue(report.getServicePoint());
                cell13.setCellValue(report.getCustomerName());
                cell14.setCellValue(report.getCustomerPosition());
                value = report.getCustomerTelephone();
                if (StringUtils.isEmpty(value)) {
                    cell15.setCellValue("");
                } else {
                    cell15.setCellValue(value);
                }


                cell16.setCellValue(report.getMsgSended());
                cell17.setCellValue(report.getCreateCustomerReportTime());
                value = report.getScore();
                cell18.setCellValue(Integer.valueOf(value));

                String value1 = report.getQuestionScore_1().replace("%", "");
                cell19.setCellValue(Integer.valueOf(value1));

                String value2 = report.getQuestionScore_2().replace("%", "");
                cell20.setCellValue(Long.valueOf(value2));

                String value3 = report.getQuestionScore_3().replace("%", "");
                cell21.setCellValue(Integer.valueOf(value3));

                String value4 = report.getQuestionScore_4().replace("%", "");
                cell22.setCellValue(Integer.valueOf(value4));

                String value5 = report.getQuestionScore_5().replace("%", "");
                cell23.setCellValue(Integer.valueOf(value5));

                String value6 = report.getQuestionScore_6().replace("%", "");
                cell24.setCellValue(Integer.valueOf(value6));

                String value7 = report.getQuestionScore_7().replace("%", "");
                cell25.setCellValue(Integer.valueOf(value7));
                cell26.setCellValue(report.getManageNote().replaceAll("<[^>]+>", "\n"));
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        return workbook;
    }


    public static float getExcelCellAutoHeight(String str, int fontCountInline) {
        //每一行的高度指定
        float defaultRowHeight = 12.00f;
        float defaultCount = 0.00f;
        for (int i = 0; i < str.length(); i++) {
            float ff = 1.00f;
            defaultCount = defaultCount + ff;
        }
        //计算
        return ((int) (defaultCount / fontCountInline) + 1) * defaultRowHeight;
    }


    //保留2位小数 并转成String
    private String doubleGeTowDecimal(Double doubleNum) {
        DecimalFormat format = new DecimalFormat("00.00");
        String doubleStr = format.format(doubleNum);
        try {
            return new String(doubleStr.getBytes("UTF-8"), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return "00.00";
        }
    }

}
